import request from '@/utils/request';

const API = {
    // 留宿申请条查看
    STAY_NOTE_URL: '/v1/biz/leaves/dormitory',
    // 获取宿舍
    GET_DORMITORY_URL: '/v1/school/department/dorm',
    // 获取宿舍楼层
    GET_DORMITORY_FLOOR_RUL: '/v1/school/class/dormName',
    // 查询留宿申请
    INQUIRE_STAY_NOTE_URL: '/v1/biz/leaves/selectDormitory',
    // 获取宿舍条详情
    GET_DORMITORY_NOTE_DETAIL_URL: '/v1/biz/leaves/dormitory'
};

// 获取宿舍
export const reqDormitory = () => request.get(API.GET_DORMITORY_URL);

// 获取宿舍楼层
export const reqDormitoryFloor = id =>
    request.get(`${API.GET_DORMITORY_FLOOR_RUL}?depId=${id}`);

// 查询留宿申请
export const reqInquireStayNote = data =>
    request.post(API.INQUIRE_STAY_NOTE_URL, data);

// 获取宿舍条详情
export const reqDormitoryNoteDetail = id =>
    request.get(`${API.GET_DORMITORY_NOTE_DETAIL_URL}/${id}/`);
